import 'package:word_game/engine/core.dart';
import 'package:word_game/battle/battle.dart';

class MHSNSkill extends Skill {
  MHSNSkill() : super('梅花三弄');

  @override
  List<Monster> determineTargets(List<Monster> alternatives) {
    if (alternatives == null || alternatives.length == 0) {
      return null;
    }
    if (alternatives.length<=3) {
      return alternatives;
    }

    alternatives.sort((Monster mon1, Monster mon2) => mon2.vitality.compareTo(mon1.vitality));
    return alternatives.sublist(0, 3);
  }

  @override
  AttackAction determineAction(Hero hero) {
    AttackAction action = AttackAction();
    action.attackType = DamageType.physical;
    action.attackNumber = (hero.attackPower * 1.5).floor();
    return action;
  }
  
}